package com.lanou.dllo.shise.com.lanou.dllo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;

import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.View;


import com.lanou.dllo.shise.com.lanou.dllo.fragment.MyFragmentFactory;


/**
 * Created by dllo on 15/10/21.
 */
public class HomePagerAdapter extends FragmentPagerAdapter {

    private String[] titles = {"关注", "同城", "精选"};

    public HomePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return MyFragmentFactory.newInstance(position);
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}